﻿
/*----------------------------------------------------------------
 * 创建时间：2023/9/5 11:02:06
 * 作  者：wenlli 
 * 项  目：Minotaur.App.Core.Exceptions 
 * 描  述：全局异常类
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时  间：
 * 修改说明：
 * 
 *----------------------------------------------------------------*/


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Minotaur.App.Core.Exceptions
{
    /// <summary>
    /// 全局异常类
    /// </summary>
    public class GlobalException : Exception
    {
        public GlobalException()
        {
        }

        public GlobalException(string message) : base(message)
        {
        }

        public GlobalException(string message, Exception innerException) : base(message, innerException)
        {
        }

        public GlobalException(Type type = null, string methodName = "", object paramter = null, GlobalUserModel globalUserModel = null, string message = "") : base(message)
        {
            Type = type;
            MethodName = methodName;
            Paramter = paramter;
            GlobalUserModel = globalUserModel;
        }

        protected GlobalException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }

        /// <summary>
        /// 当前出现异常类
        /// </summary>
        public Type Type { get; set; }

        /// <summary>
        /// 方法名称
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// 传入参数
        /// </summary>
        public object Paramter { get; set; }


        /// <summary>
        /// 当前登录用户信息
        /// </summary>
        public GlobalUserModel GlobalUserModel { get; set; }
    }
}
